Entity Actor

Actor contains functions for operating on Actor entity types.

Subclass of Entity.

Functions

GetAttribute (attrib, tab) GetAttribute returns the value of the named attribute from the Actor, in the requested table.
SetAttribute (attrib, tab, value) SetAttribute adjusts the value of the named attribute for the Actor, in the requested table.
ApplyBonus (attribs, perm) ApplyBonus adds a temporary or permanent bonus to the attributes of the Actor.
RemoveBonus (attribs, perm) RemoveBonus subtracts a temporary or permanent bonus from the attributes of the Actor.
GetInventory () GetInventory returns the inventory of the Actor.
DisplayMessage (msg) DisplayMessage shows the given message above the Actor for a short time.
EquipItem (item, slot) EquipItem equips the given Entity on one of the Actor's equip slots.
UnequipItem (slot) UnequipItem removes any equipped Entity on one of the Actor's equip slots
GetEquippedItem (slot) GetEquippedItem returns the Entity equipped in one of the Actor's equip slots.


Functions

GetAttribute (attrib, tab)
GetAttribute returns the value of the named attribute from the Actor, in the requested table. Each actor has four tables, reflecting permanent, derived, temporary, and current values for each attribute.

Parameters:

  • attrib The name of the attribute, as shown in the Fallout: Tactics entity editor.
  • tab The table to retrieve from. One of ACTOR_TABLE_PERM, ACTOR_TABLE_DERIVED, ACTOR_TABLE_TEMPORARY, or ACTOR_TABLE_CURRENT.

Returns:

    The value of the requested attribute. May be a boolean for tag_* fields or traits; otherwise is an integer value.
SetAttribute (attrib, tab, value)
SetAttribute adjusts the value of the named attribute for the Actor, in the requested table. Each actor has four tables, reflecting permanent, derived, temporary, and current values for each attribute. Prefer to use ApplyBonus or RemoveBonus for temporary adjustments wherever possible, as the resulting value will be calculated immediately.

Parameters:

  • attrib The name of the attribute, as shown in the Fallout: Tactics entity editor.
  • tab The table to set. One of ACTOR_TABLE_PERM, ACTOR_TABLE_DERIVED, ACTOR_TABLE_TEMPORARY, or ACTOR_TABLE_CURRENT.
  • value The value to set, Should be a boolean for tag_* or trait fields, otherwise an integer.

Returns:

    None.
ApplyBonus (attribs, perm)
ApplyBonus adds a temporary or permanent bonus to the attributes of the Actor. Temporary bonuses are often highlighted in blue (for positive) or red (for negative), by default, on the character screen.

Parameters:

  • attribs A table containing the bonus to apply. Table fields should be named as for the attributes to grant bonus, and each field's value should be the amount to increase the attribute by.
  • perm A boolean flag indicating if the adjustment should be permanent.

Returns:

    None.
RemoveBonus (attribs, perm)
RemoveBonus subtracts a temporary or permanent bonus from the attributes of the Actor. Temporary bonuses are often highlighted in blue, by default, on the character screen.

Parameters:

  • attribs A table containing the bonus to remove. Table fields should be named as for the attributes to grant bonus, and each field's value should be the amount to decrease the attribute by. NOTE that the value should be what was granted by the initial bonus (e.g. to remove a bonus of positive 3, specify positive 3 in the RemoveBonus call as well).
  • perm A boolean flag indicating if the adjustment should be permanent.

Returns:

    None.
GetInventory ()
GetInventory returns the inventory of the Actor.

Returns:

    An array of Collectable objects comprising the Actor's inventory.
DisplayMessage (msg)
DisplayMessage shows the given message above the Actor for a short time.

Parameters:

  • msg The message to display.

Returns:

    None.
EquipItem (item, slot)
EquipItem equips the given Entity on one of the Actor's equip slots.

Parameters:

  • item The Entity to equip. This should be a subclass of Collectable.
  • slot The inventory slot to equip the entity into. Can be a hand or an armor slot. Values are EQUIP_SLOT_LEFT, EQUIP_SLOT_RIGHT, or EQUIP_SLOT_ARMOR.

Returns:

    If successful, returns an Entity object for the item previously equipped. May be a null entity, with ClassType 'Entity', or an actual entity. If an actual entity is returned, the script must do something appropriate; e.g. put into a container or inventory, or Destructed.

Or

  1. If failed, the first parameter returned is the Entity that was to be equipped. This Entity must be properly dispositioned as above.
  2. If failed, the second parameter returned is an error string indicating why the equip failed.
UnequipItem (slot)
UnequipItem removes any equipped Entity on one of the Actor's equip slots

Parameters:

  • slot The inventory slot to unequip. Can be a hand or an armor slot. Values are EQUIP_SLOT_LEFT, EQUIP_SLOT_RIGHT, or EQUIP_SLOT_ARMOR.

Returns:

    If successful, returns an Entity object for the item previously equipped. May be a null entity, with ClassType 'Entity', or an actual entity. If an actual entity is returned, the script must do something appropriate; e.g. put into a container or inventory, or Destructed.

Or

  1. If failed, the first parameter returned is the null Entity. Nothing needs be done with this entity.
  2. If failed, the second parameter returned is an error string indicating why the unequip failed.
GetEquippedItem (slot)
GetEquippedItem returns the Entity equipped in one of the Actor's equip slots.

Parameters:

  • slot The inventory slot to check. Can be a hand or an armor slot. Values are EQUIP_SLOT_LEFT, EQUIP_SLOT_RIGHT, or EQUIP_SLOT_ARMOR.

Returns:

    An Entity object for the item equipped in the slot. May be a null entity, with ClassType 'Entity', or an actual entity. Do not move or Destruct this entity without unequipping it first.
generated by LDoc 1.4.6 Last updated 2021-05-07 19:14:47